home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Megarom
/
Megarom Macintosh CD Software (Quantum Leap)(1992).iso
/
COMMUNICATION
/
BBS Software Systems
/
Hermes ƒ
/
HEI 1.0.7
/
UpdatePhone.p
< prev
next >
Wrap
Text File
|
1990-12-31
|
3KB
|
105 lines
unit UpdPhoneExt;
interface
uses
HermHeaders;
procedure MAIN (HermSetup: UserXIPtr);
implementation
procedure MAIN (HermSetup: UserXIPtr);
var
i: integer;
t1: str255;
begin
with HermSetup^ do
begin
if message <> closeExternal then
begin
if privates = nil then {never been called before}
begin
privates := myPrivsHand(NewHandle(SizeOf(myPrivs)));
MoveHHi(handle(privates));
HNoPurge(handle(privates));
for i := 1 to 10 do
begin
privates^^.activeOn[i] := false;
privates^^.stage[i] := 0;
end;
end;
if not privates^^.activeOn[curNode^] then
begin
privates^^.activeOn[curNode^] := true;
privates^^.stage[curNode^] := 1;
end;
end;
case message of
closeExternal:
begin
if privates <> nil then
begin
HPurge(handle(privates));
DisposHandle(handle(privates));
privates := nil;
end;
end;
closeNode:
begin
privates^^.activeOn[curNode^] := false;
privates^^.stage[curNode^] := 0;
end;
activeExt:
begin
case privates^^.stage[curNode^] of
1:
begin
bCR(procs[0]);
OutLine('Your current phone number is:', true, 0, procs[1]);
OutLine(n[curNode^]^.thisUser.phone, true, 0, procs[1]);
bCR(procs[0]);
bCR(procs[0]);
YesNoQuestion('Do you wish to change it? ', false, procs[6]);
privates^^.stage[curNode^] := 2;
end;
2:
begin
if n[curNode^]^.curPrompt = 'Y' then
begin
OutLine('Enter new number.', true, 0, procs[1]);
bCR(procs[0]);
LettersPrompt(': ', '', 12, false, false, true, char(0), procs[4]);
privates^^.stage[curNode^] := 3;
end
else
begin
privates^^.activeOn[curNode^] := false;
privates^^.stage[curNode^] := 0;
n[curNode^]^.activeuserExternal := -1;
end;
end;
3:
begin
t1 := n[curNode^]^.curPrompt;
if ((length(t1) = 12) and (t1[4] = '-') and (t1[8] = '-')) or (HSystPtr^.freePhone and (length(t1) > 9)) then
begin
n[curNode^]^.thisUser.phone := t1;
OutLine('Your phone number has been updated.', true, 0, procs[1]);
end
else
begin
OutLine('Number not changed, format invalid.', true, 0, procs[1]);
end;
privates^^.activeOn[curNode^] := false;
privates^^.stage[curNode^] := 0;
n[curNode^]^.activeuserExternal := -1;
end;
otherwise
end;
end;
otherwise
end;
end;
end;
end.